namespace OpenComposite.HumanActivity.Contracts
{
	using System;
	using System.Runtime.Serialization;

	/// <summary>
	/// Activity informations.
	/// </summary>
	[DataContract(Namespace = "http://www.theopencomposite.com/internal")]
	public class ActivityInfo
	{
		#region Public Members

		#region Properties

		/// <summary>
		/// Gets or sets the activity ID.
		/// </summary>
		/// <value>The activity ID.</value>
		[DataMember]
		public int ActivityID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the user ID.
		/// </summary>
		/// <value>The user ID.</value>
		[DataMember]
		public int UserID
		{
			get;
			set;
		}

		#endregion Properties

		#endregion Public Members
	}

	/// <summary>
	/// Informations about a human activity form.
	/// </summary>
	[DataContract(Namespace = "http://www.theopencomposite.com/internal")]
	public class FormInfo
	{
		#region Initialization

		/// <summary>
		/// Initializes a new instance of the <see cref="FormInfo"/> class.
		/// </summary>
		public FormInfo()
		{
			Version = "";
			URL = "";
		}

		#endregion Initialization

		#region Public Members

		#region Properties

		/// <summary>
		/// Gets or sets the URL.
		/// </summary>
		/// <value>The URL.</value>
		[DataMember]
		public string URL { get; set; }

		/// <summary>
		/// Gets or sets the version.
		/// </summary>
		/// <value>The version.</value>
		[DataMember]
		public string Version { get; set; }

		[DataMember]
		public string AssemblyName { get; set; }
		[DataMember]
		public string FormName { get; set; }

		#endregion Properties

		#endregion Public Members
	}

	/// <summary>
	/// The login user data.
	/// </summary>
	[DataContract(Namespace = "http://www.theopencomposite.com/internal")]
	public class LogInData
	{
		#region Initialization

		/// <summary>
		/// Initializes a new instance of the <see cref="LogInUserData"/> class.
		/// </summary>
		/// <remarks/>
		public LogInData()
		{
			UserID = null;
			ScreenResolutionID = 0;
			LanguageID = 0;
			OrganizationID = 0;
			MenuID = 0;
			UserLCID = 0;
			IsSystemAdministrator = false;
			IsRootSystemAdministrator = false;
			IsProcessOwner = false;
			CanUpdate = false;
			ReturnCode = "ERROR";
			ReturnMessage = "";
			WebFileLocation = "";
			WebAddress = "";
			ApplicationName = "";
			OrganizationName = "";
			UserTimeZoneOffSet = 0;
			RealUserTimeZoneOffSet = 0;
			LoginId = System.Guid.Empty;
			FullName = "";
			OrganizationUnits = new OrganizationUnit[0];
			UserRoles = new UserRole[0];
		}

		#endregion Initialization

		#region Public Members

		#region Properties

		/// <summary>
		/// Gets or sets the name of the application.
		/// </summary>
		/// <value>The name of the application.</value>
		[DataMember]
		public string ApplicationName
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets a value indicating whether this instance can update.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance can update; otherwise, <c>false</c>.
		/// </value>
		[DataMember]
		public bool CanUpdate
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the full name.
		/// </summary>
		/// <value>The full name.</value>
		[DataMember]
		public string FullName
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets a value indicating whether this instance is process owner.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is process owner; otherwise, <c>false</c>.
		/// </value>
		[DataMember]
		public bool IsProcessOwner
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets a value indicating whether this instance is root system administrator.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is root system administrator; otherwise, <c>false</c>.
		/// </value>
		[DataMember]
		public bool IsRootSystemAdministrator
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets a value indicating whether this instance is system administrator.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is system administrator; otherwise, <c>false</c>.
		/// </value>
		[DataMember]
		public bool IsSystemAdministrator
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the language ID.
		/// </summary>
		/// <value>The language ID.</value>
		[DataMember]
		public int LanguageID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the login id.
		/// </summary>
		/// <value>The login id.</value>
		[DataMember]
		public Guid LoginId
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the menu ID.
		/// </summary>
		/// <value>The menu ID.</value>
		[DataMember]
		public int MenuID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the organization ID.
		/// </summary>
		/// <value>The organization ID.</value>
		[DataMember]
		public int OrganizationID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the name of the organization.
		/// </summary>
		/// <value>The name of the organization.</value>
		[DataMember]
		public string OrganizationName
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the organization units.
		/// </summary>
		/// <value>The organization units.</value>
		/// <remarks/>
		[DataMember]
		public OrganizationUnit[] OrganizationUnits
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the real user time zone off set.
		/// </summary>
		/// <value>The real user time zone off set.</value>
		[DataMember]
		public decimal RealUserTimeZoneOffSet
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the return code.
		/// </summary>
		/// <value>The return code.</value>
		[DataMember]
		public string ReturnCode
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the return message.
		/// </summary>
		/// <value>The return message.</value>
		[DataMember]
		public string ReturnMessage
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the screen resolution ID.
		/// </summary>
		/// <value>The screen resolution ID.</value>
		[DataMember]
		public int ScreenResolutionID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the user ID.
		/// </summary>
		/// <value>The user ID.</value>
		[DataMember]
		public int? UserID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the user LCID.
		/// </summary>
		/// <value>The user LCID.</value>
		[DataMember]
		public int UserLCID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the user roles.
		/// </summary>
		/// <value>The user roles.</value>
		/// <remarks/>
		[DataMember]
		public UserRole[] UserRoles
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the user time zone off set.
		/// </summary>
		/// <value>The user time zone off set.</value>
		[DataMember]
		public decimal UserTimeZoneOffSet
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the web address.
		/// </summary>
		/// <value>The web address.</value>
		[DataMember]
		public string WebAddress
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the web file location.
		/// </summary>
		/// <value>The web file location.</value>
		[DataMember]
		public string WebFileLocation
		{
			get;
			set;
		}

		#endregion Properties

		#endregion Public Members
	}

	/// <summary>
	/// An organizational unit.
	/// </summary>
	[DataContract(Namespace = "http://www.theopencomposite.com/internal")]
	public class OrganizationUnit
	{
		#region Initialization

		/// <summary>
		/// Initializes a new instance of the <see cref="OrganizationUnit"/> class.
		/// </summary>
		public OrganizationUnit()
		{
			ID = null;
			Name = "";
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="OrganizationUnit"/> class.
		/// </summary>
		/// <param name="orgUnitId">The org unit id.</param>
		/// <param name="sOrgUnitName">Name of the s org unit.</param>
		public OrganizationUnit(int orgUnitId, string sOrgUnitName)
		{
			ID = orgUnitId;
			Name = sOrgUnitName;
		}

		#endregion Initialization

		#region Public Members

		#region Properties

		/// <summary>
		/// Gets or sets the organization unit ID.
		/// </summary>
		/// <value>The organization unit ID.</value>
		[DataMember]
		public int? ID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the name of the organization unit.
		/// </summary>
		/// <value>The name of the organization unit.</value>
		[DataMember]
		public string Name
		{
			get;
			set;
		}

		#endregion Properties

		#region Methods

		/// <summary>
		/// Returns a <see cref="System.String"/> that represents this instance.
		/// </summary>
		/// <returns>
		/// A <see cref="System.String"/> that represents this instance.
		/// </returns>
		public override string ToString()
		{
			return Name;
		}

		#endregion Methods

		#endregion Public Members
	}

	/// <summary>
	/// A role of an user.
	/// </summary>
	[DataContract(Namespace = "http://www.theopencomposite.com/internal")]
	public class UserRole
	{
		#region Initialization

		/// <summary>
		/// Initializes a new instance of the <see cref="UserRole"/> class.
		/// </summary>
		public UserRole()
		{
			ID = null;
			Name = "";
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="UserRole"/> class.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <param name="sName">Name of the s.</param>
		public UserRole(int id, string sName)
		{
			ID = id;
			Name = sName;
		}

		#endregion Initialization

		#region Public Members

		#region Properties

		/// <summary>
		/// Gets or sets the ID.
		/// </summary>
		/// <value>The ID.</value>
		[DataMember]
		public int? ID
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the name.
		/// </summary>
		/// <value>The name.</value>
		[DataMember]
		public string Name
		{
			get;
			set;
		}

		#endregion Properties

		#region Methods

		/// <summary>
		/// Returns a <see cref="System.String"/> that represents this instance.
		/// </summary>
		/// <returns>
		/// A <see cref="System.String"/> that represents this instance.
		/// </returns>
		public override string ToString()
		{
			return Name;
		}

		#endregion Methods

		#endregion Public Members
	}
}